import Vue from 'vue'
import VueRouter from 'vue-router'
import Article from '@/views/Article'
import ArticleDetail from '@/views/ArticleDetail'
import Collect from '@/views/Collect'
import Layout from '@/views/Layout'
import Like from '@/views/Like'
import User from '@/views/User'
Vue.use(VueRouter)

const router = new VueRouter({

  routes: [
    {
      path: '/', component: Layout, redirect: '/article',
      // 二级路由
      children: [
        { path: '/article', component: Article },
        { path: '/collect', component: Collect },
        { path: '/like', component: Like },
        { path: '/User', component: User }
      ]
    },
    { path: '/detail/:id', component: ArticleDetail }
  ]
})



export default router